﻿@using Microsoft.AspNet.Identity
@using UA.Framework
@using UA.Framework.Authorization

<div class="login-partial">
    @if (UAAuthentication.IsAuthenticated)
    {
        using (Html.BeginForm("SignOut", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" }))
        {
            @Html.AntiForgeryToken()
            <ul>
                <li>
                    @Html.ActionLink("你好," + UAAuthentication.UserToken.UserName + "!", "Manage", "Account", routeValues: null, htmlAttributes: new { title = "管理" })
                </li>
                <li><a href="javascript:document.getElementById('logoutForm').submit()">注销</a></li>
            </ul>
        }
    }
    else
    {
        <ul>
            <li>@Html.ActionLink("注册", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li>
            <li>@Html.ActionLink("登录", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
        </ul>
    }
</div>